/*
 *  Copyright (C) 2010 Zubanov Dmitry
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


/**
 *
 * @author Zubanov Dmitry aka javadimon, zubanov@gmail.com
 * Omsk, Russia, created 02.10.2010
 * (C) Copyright by Zubanov Dmitry
 */

package org.jssdb.core.filesystem;

import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;

public class AddedFilesList implements Serializable{
    
    private ArrayList<FileObjectInfo> addedList;
    private String host;
    private int port;
    public static int REQUEST = 0, RESPONSE = 1;
    private int status = 0;

    public AddedFilesList(String host, int port, ArrayList<FileObjectInfo> addedList){
        this.host = host;
        this.port = port;
        this.addedList = addedList;
    }

    public void setFilesObject(){
        for(FileObjectInfo fileObjectInfo : addedList){
            fileObjectInfo.setObject();
        }
    }

    public void setStatus(int status){
        this.status = status;
    }

    public int getStatus(){
        return status;
    }

    public ArrayList<FileObjectInfo> getAddedList(){
        return addedList;
    }

    public String getHost() {
        return host;
    }

    public int getPort() {
        return port;
    }

    @Override
    public String toString(){
        return MessageFormat.format("Host {0}, port {1}, {2}",
                new Object[]{host, port, addedList});
    }

}
